Vue.component('my-menu', {
  template: '<div class="menu_nav">'+
	  '<span class="button" v-bind:class="{cur:curMenu==\'market\'}" v-on:click="selectMenu(\'market\')"><img v-if="curMenu!==\'market\'" style="width: 33px; height: 36px" src="/static/app/images/market_normal.png"/><img v-else style="width: 33px; height: 36px" src="/static/app/images/market_pressed.png"/><span class="mtxt" style="font-size: 0.6rem">市场</span></span>'+
	  '<span class="button" v-bind:class="{cur:curMenu==\'trade\'}" v-on:click="selectMenu(\'trade\')"><img v-if="curMenu!==\'trade\'" style="width: 33px; height: 36px" src="/static/app/images/transaction_normal.png"/><img v-else style="width: 33px; height: 36px" src="/static/app/images/transaction_pressed.png"/><span class="mtxt" style="font-size: 0.6rem">交易</span></span>'+
	  '<span class="button" v-bind:class="{cur:curMenu==\'assets\'}" v-on:click="selectMenu(\'assets\')"><img v-if="curMenu!==\'assets\'" style="width: 33px; height: 36px" src="/static/app/images/c2c_normal.png"/><img v-else style="width: 33px; height: 36px" src="/static/app/images/c2c_pressed.png"/><span class="mtxt" style="font-size: 0.6rem">资金</span></span>'+
	  '<span class="button" v-bind:class="{cur:curMenu==\'c2c\'}" v-on:click="selectMenu(\'c2c\')"><img v-if="curMenu!==\'c2c\'" style="width: 33px; height: 36px" src="/static/app/images/assets_normal.png"/><img v-else style="width: 33px; height: 36px" src="/static/app/images/assets_pressed.png"/><span class="mtxt" style="font-size: 0.6rem">充值</span></span>'+
	  '<span class="button" v-bind:class="{cur:curMenu==\'myself\'}" v-on:click="selectMenu(\'myself\')"><img v-if="curMenu!==\'myself\'" style="width: 33px; height: 36px" src="/static/app/images/assets_normal.png"/><img v-else style="width: 33px; height: 36px" src="/static/app/images/assets_pressed.png"/><span class="mtxt" style="font-size: 0.6rem">我的</span></span>'+
  '</div>',
  data:function () {
        return {
            curMenu:page
        }
    },
    methods:{
        selectMenu:function (n) {
            this.curMenu=n;
            this.to_page(n);
        },
		to_page:function(page){
			if(page=='market'){
                window.location.href = '/m/market';
			}else if(page=='trade'){
                window.location.href = '/m/trade#/trade';
			}else if(page=='assets'){
                window.location.href = '/m/balances';
			}else if(page=='c2c'){
                window.location.href = '/c2c/?m=1';
			}else if(page=='myself'){
                window.location.href = '/users/login?next=/m/market';
			}else{
                window.location.href = '/m/trade#/trade';
			}
        }
    }
})
